const Mock = require('mockjs');

const data = Mock.mock({
  'items|30': [
    {
      id: '@id',
      title: '@sentence(10, 20)',
      'status|1': ['published', 'draft', 'deleted'],
      author: 'name',
      display_time: '@datetime',
      pageviews: '@integer(300, 5000)'
    }
  ]
});

module.exports = [
  {
    url: '/vue2-element-admin/table/list',
    type: 'get',
    response: () => {
      const { items } = data;
      return {
        code: 20000,
        data: {
          total: items.length,
          items
        }
      };
    }
  }
];
